//
//  HWSinglePersonAlertView.m
//  HuaWan
//
//  Created by HuaWan on 16/10/17.
//  Copyright © HuaWan. All rights reserved.
//

#import "HWSinglePersonAlertView.h"

@implementation HWSinglePersonAlertView

+ (id)instanceView {
    NSArray* nibView =  [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:self options:nil];
    return [nibView objectAtIndex:0];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Do any additional setup after loading the view.
}

//显示
- (void)show {
        
    self.hidden = NO;
        
    [UIView animateWithDuration:0.5 animations:^{
        self.maskView.alpha = 0.5;
    } completion:^(BOOL finished) {
        
    }];
}

- (void)dismiss {
    [UIView animateWithDuration:0.5 animations:^{
       self.maskView.alpha = 0;
    } completion:^(BOOL finished) {
       self.hidden = YES;
    }];
}

#pragma mark  FKDJoinAtlasCellDelegat 取消
    
- (IBAction)buttonAction:(UIButton *)sender {
    if (_buttonAction) {
        _buttonAction(self,sender);
    }
    [self dismiss];
}

- (IBAction)tapButtonAction:(UITapGestureRecognizer *)sender {
    if (_buttonAction) {
        _buttonAction(self,nil);
    }
    [self dismiss];
}

@end
